import logging

logging.basicConfig(filename='log.log',level=logging.INFO,
                    format='%(asctime)s [%(levelname)s] %(message)s (%(filename)s:%(lineno)s)',datefmt='%m/%d%Y %I:%M:%S: %p')

logging.debug("这是debug日志")
logging.warning('Watch out!')
logging.info('I told you so')
logging.error("这是一条error的日志")